Conversation
…ns for choosing a build database strategy
… config. And start a little state machine for the migrate wizard
…nction, not pre-defined ones. And handle errors
…sconnecting an atproto session
Member
Author
|
I've got atproto OAuth working! Screen.Recording.2025-02-04.at.3.08.26.PM.mov |
…show it to the user
… displays a progress bar, and supports canceling
…o Bluesky page it works
… the archive. Update the archive to display links to the migrated posts. Also, make sure to update premium status when XWizardMigrateBluesky mounts
…ruary 18, 2025 (we will need to update this date when we know the release date)
…tter, now that we have a right sidebar with navigation
Contributor
…es for all domains, not just x.com
…/followings/tweets/likes counts by making a graphQL query
Member
Author
redshiftzero
approved these changes
Feb 19, 2025
Contributor
redshiftzero
left a comment
There was a problem hiding this comment.
getting the user ID from this.account.userID resolved for me! LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Resolves #369.
cyd://protocol linksBefore reviewing this PR, we should review and merge #393. I've merged those commits into this branch, so merging that into
mainwill make this branch have far fewer commits.Here's a brief tour of this feature and the related changes in this branch. First, I'm going to start with a fresh instance of Cyd Dev by deleting the app data and deleting the data in my test account:
New navigation
I open Cyd and add my test X account and login to X. The interface looks like this:
In the right sidebar of an X account, there's now nav menu with "Local Database", "Delete from X", and "Migrate to Bluesky". Before there was no nav, and you just got around via buttons in the wizard.
As part of this PR, I've also changed the messaging it shows you when you haven't imported any data yet. If you switch to Delete from X, it shows this prominent warning and encourages you to build your local database first:
A similar warning was shown before, but I think this looks better. Also on the Delete from X page, it shows the disabled options (delete my tweets, delete my retweets, delete my looks) isn't of completely hiding them.
The same warning is on the Migrate to Bluesky page:
Info/warning alerts after you have some data
Next, I built a database from scratch, and now the three pages show that last time the database was built (or imported from an archive). The Local Database page doesn't have a button:
But the Delete from X and Migrate to Bluesky pages do:
Note that it determines whether or not you have data by loading the
lastFinishedJob_indexTweets,lastFinishedJob_indexLikes, andlastFinishedJob_importArchiveaccount config settings, which store timestamps. If I go through and update the timestamps in the SQL database to be before February 18, 2025, the Migrate to Bluesky page shows you this warning:REMINDER: Before releasing this in prod, we should update this date to be the release date. It's hardcoded in
XWizardMigrateBluesky.vue.The Cyd archive before migrating
At this point, if you browse the Cyd archive, it looks like this. It has all of the fancy stuff from #393, and there's a link to the original tweet, but there's no link to the migrated version in Bluesky yet.
Bluesky OAuth
I put my test Bluesky handle (
nexamind-cyd.bsky.social) in Cyd and click Connect:This opens a new tab in my browser to authenticate to Bluesky:
I click Accept, and it redirects to a special cyd.social URL:
I click "Open Link" and the Cyd app responds saying I'm successfully connected (note you can test canceling in the OAuth flow too, everything should be handled). Once you're connected, you can start migrating to Bluesky. It tells you the number of tweets it can migrate, the number it can't migrate because they're replies, and the number that have already been migrated:
When you click "Start Migrating to Bluesky", it verifies that you have premium access.
Premium check
This is a premium feature, so I want to make the premium flow is seamless. I had to update how the premium check works a bit from before. But basically, if you're not signed in to a Cyd account or you're signed in but haven't paid for premium, it brings you to premium check page and shows you the feature is "Migrate tweets to Bluesky":
The old premium check view used to determine exactly what features were required by loading account settings from the database (like, deleteLikes). But this is a new premium feature that isn't storing anything in the account settings, so I've introduced two new localStorage items:
premiumCheckReason-${accountID}andpremiumTasks-${accountID}.If a user doesn't have premium, before redirecting to the premium check, it sets
premiumCheckReasontomigrateTweetsToBlueskyand it setspremiumTasksto a list of tasks, which is just one right now ("Migrate tweets to Bluesky"):When you're trying to delete your data, before redirecting the user to premium check, it now sets
premiumCheckReasonin localStorage todeleteData. And the premium check view uses this information to determine what features to display, and also what the back button should say and where it should go. So if you're trying to delete data with a bunch of premium features enabled, the premium check looks like this now, where the back button brings you to the delete review page:Anyway, back to migrating to Bluesky: I envision people may want to pay for premium directly so they can move forward and migrate their tweets, so I want this flow to be flawless. After logging in (my account has already paid for premium) it shows this:
The button is "Migrate to Bluesky" in this case, but if I were doing this flow from the Delete from X page, then the button would bring me back to deletion options.
Once I'm signed in and I have premium, clicking "Start Migrating to Bluesky" will actually migrate to Bluesky.
Migration
As soon as you click the button, it migrates all of your tweets super fast. It gets all 58 of mine in a few seconds. Here's a screenshot I snagged.
When it's done, it tells you how many tweets it migrated and there's a link to load your Bluesky profile:
If there are any errors while migrating, it shows you the errors here too, which I'll get to in a second.
Over on Bluesky, everything should get migrated. Here's a video that was migrated:
Here's a tweet with multiple images and also a thread:
Here's a quoted tweet, quoting a a different X account:
The migrate to Bluesky feature supports the following:
t.colinks with actual URLs, and it adds facets to turn these URLs into actual linksrecordWithMedia-- which is a quote post that also includes mediaAfter you migrate your tweets to Bluesky, there's now a button to delete them if you want (I used this for debugging):
That should delete all of the posts that were migrated. And when you browse your archive, all of the migrated tweets should now have a "migrated to Bluesky" link which links to the new Bluesky post.